import http from '@/utils/http'
const env = import.meta.env
const BASE_URL = env.PROD ? `${env.VITE_API_BASE_URL}/api` : '/api'
const BASE_URL11 = env.PROD ? `${env.VITE_API_BASE_URL11}/admin` : '/cloudCrossOrder'

/** 订单明细 */
export function orderEsLists(params: any) {
  return http.post(`${BASE_URL}/v1/order/esLists`, params)
}

/** 导出订单 */
export function orderExport(params: any) {
  return http.get(`${BASE_URL}/v1/order/export`, params, {}, 'blob')
}

/** 导出订单 */
export function esTbExport(params: any) {
  return http.get(`${BASE_URL}/v1/order/esTbExport`, params, {}, 'blob')
}

/** 违规订单 - 列表 */
export function tbViolationLogList(params: any) {
  return http.get(`${BASE_URL}/v1/tbViolationLog/index`, params)
}

/** 违规订单 - 修改 */
export function tbViolationLogUpdate(params: any) {
  return http.post(`${BASE_URL}/v1/tbViolationLog/update`, params)
}

/** 违规订单 - 新增 */
export function tbViolationLogStore(params: any) {
  return http.post(`${BASE_URL}/v1/tbViolationLog/store`, params)
}

/** 违规订单 - 删除 */
export function tbViolationLogDestroy(params: any) {
  return http.post(`${BASE_URL}/v1/tbViolationLog/destroy`, params)
}

/** 订单概览-下单爆款 */
export function goodsRankData(params: any) {
  return http.post(`${BASE_URL}/v1/stat/order/goodsRankData`, params)
}

/** 订单概览-店铺榜单 */
export function shopRankData(params: any) {
  return http.post(`${BASE_URL}/v1/stat/order/shopRankData`, params)
}

/** 订单概览-品类分布 */
export function categoryRangeData(params: any) {
  return http.post(`${BASE_URL}/v1/stat/order/categoryRangeData`, params)
}

/** 订单概览-店铺分布 */
export function shopRangeData(params: any) {
  return http.post(`${BASE_URL}/v1/stat/order/shopRangeData`, params)
}

/** 订单概览-店铺分布-商品排行 */
export function goodsRankDataByShop(params: any) {
  return http.post(`${BASE_URL}/v1/stat/order/goodsRankDataByShop`, params)
}

/** 订单概览-客单价分布 */
export function priceRangeData(params: any) {
  return http.post(`${BASE_URL}/v1/stat/order/priceRangeData`, params)
}

/** 京东渠道ID奖励 */
export function jdRewardOrder(params: any) {
  return http.get(`${BASE_URL}/v1/jdRewardOrder/pageInfo`, params)
}

/** 京东通过类目查单 */
export function getJdOrderByCategory(params: any) {
  return http.post(`${BASE_URL}/v1/stat/order/getJdOrderByCategory`, params)
}

/** 类目商品排行 */
export function goodsRankDataByCategory(params: any) {
  return http.post(`${BASE_URL}/v1/stat/order/goodsRankDataByCategory`, params)
}

/** 比价商品订单排行 */
export function compareGoodsOrderRankData(params: any) {
  return http.post(`${BASE_URL}/v1/stat/order/compareGoodsOrderRankData`, params)
}

/** 比价商品订单排行导出 */
export function compareGoodsOrderRankExport(params: any) {
  return http.post(`${BASE_URL}/v1/stat/order/compareGoodsOrderRankExport`, params, {}, 'blob')
}

/** 比价商品订单基础数据 */
export function compareGoodsOrderPageInfo(params: any) {
  return http.post(`${BASE_URL}/v1/stat/order/compareGoodsOrderPageInfo`, params)
}

/** 获取云发单跨店订单列表 */
export function cloudCrossOrderList(params: any) {
  return http.post(`${BASE_URL11}/v1/order/pull/agent/orderOther/search`, params)
}

/** 获取京东团长订单列表 */
export function orderJdTeamList(params: any) {
  return http.post(`${BASE_URL11}/v1/order/pull/agent/orderJdTeam/search`, params)
}

/** 获取京东团长订单列表 */
export function orderJdTeamOrder(params: any) {
  return http.post(`${BASE_URL11}/v1/order/pull/agent/orderJdTeam/sumOrder`, params)
}

/** 同步云发单跨店订单给会员 */
export function cloudCrossOrderSyncUser(params: any) {
  return http.post(`${BASE_URL11}/v1/order/pull/agent/orderOther/syncUser`, params)
}

/** 获取开启时间列表 */
export function cloudCrossOrderEnableList(params: any) {
  return http.post(`${BASE_URL11}/v1/order/pull/agent/orderOther/enableList`, params)
}

/** 设置开启时间 */
export function cloudCrossOrderEnableSetting(params: any) {
  return http.post(`${BASE_URL11}/v1/order/pull/agent/orderOther/enableSetting`, params)
}

/** 获取当前开启时间 */
export function cloudCrossOrderEnableStatus(params: any) {
  return http.post(`${BASE_URL11}/v1/order/pull/agent/orderOther/getEnableTime`, params)
}
